/**
 * @program school-bus
 * @description: OrderMQDto
 * @author: mf
 * @create: 2020/03/19 11:06
 */

package com.eye.catcher.rabbit;

import com.eye.catcher.constants.SbCode;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 *  基类
 * </p>
 *
 * @author huzhiwei
 * @since 2022-03-02
 */
@Data
public class MQDto implements Serializable {

    private String methodCode;
    private String userId;
    private String moduleCode;
    private String moduleName;
    private Class clazz;
    private SbCode sbCode;
    private String param;
    private String remark;
    private Object result;
    private Exception e;

    public MQDto(String methodCode, String userId, String moduleCode, String moduleName, Class clazz, SbCode sbCode, String param, String remark, Object result) {
        this.methodCode = methodCode;
        this.userId = userId;
        this.moduleCode = moduleCode;
        this.moduleName = moduleName;
        this.clazz = clazz;
        this.sbCode = sbCode;
        this.param = param;
        this.remark = remark;
        this.result = result;
    }

    public MQDto addException(Exception e){
        this.e = e;
        return this;
    }
    public MQDto addResult(Object result){
        this.result = result;
        return this;
    }
}
